<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>专业数据处理平台</title>
    <meta name="description" content="这是一个 nodeRegister 页面">
    <meta name="keywords" content="nodeRegister">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="icon" type="image/png" href="${ctx}/assets/i/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="${ctx}/assets/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI"/>
    <link rel="stylesheet" href="${ctx}/assets/css/bootstrap.css">
    <link rel="stylesheet" href="${ctx}/assets/css/amazeui.min.css"/>
    <link rel="stylesheet" href="${ctx}/assets/css/admin.css">
    <link rel="stylesheet" href="${ctx}/assets/css/app.css">
    <link rel="stylesheet" type="text/css" href="${ctx}/assets/css/xcConfirm.css"/>
		<link rel="stylesheet" href="${ctx}/assets/css/select2.min.css">
</head>

<body>



<!--当前页面-->

        <!--标题-->
        <div class="tpl-content-page-title">
            工作流系统--节点
        </div>
        <!--面包屑-->
        <ol class="am-breadcrumb">
            <li><a href="#" class="am-icon-home">首页</a></li>
            <li><a href="#">调度</a></li>
            <li class="am-active">计算节点提交</li>
        </ol>

        <div class="tpl-portlet-components">

            <div class="tpl-portlet-components">

                <div class="portlet-title">
                    <div class="caption font-green bold">
                        计算节点提交
                    </div>
                </div>


                <div class="am-tabs-bd">
                    <div class="tpl-portlet-components">
                        <div class="portlet-title">
                            <div class="caption font-green">
                                新增计算节点
                            </div>
                            <div class="action" style="float: right;">
                                <ul class="actions-btn">
                                    <li class="blue" onclick="sub()">注册</li>
                                </ul>

                            </div>
                        </div>
                        <div class="am-g tpl-amazeui-form">
                            <div class="am-u-sm-12">
                                <form class="am-form am-form-horizontal" id="hostAndGroup">
                                    <div class="am-form-group">
                                        <label for="name" class="am-u-sm-3 am-form-label">节点主机名</label>
                                        <div class="am-u-sm-6">
                                            <input type="text" id="name" name='NodeName' placeholder="节点主机名"/>
                                        </div>
                                        <p id="check_name_div" class="am-u-sm-3" style="margin-top: 5px;"></p>
                                    </div>

                                    <div class="am-form-group">
                                        <label for="ip" class="am-u-sm-3 am-form-label">IP</label>
                                        <div class="am-u-sm-6">
                                            <input type="text" id="ip" name='nodeIp' placeholder="请输入主机IP">
                                        </div>
                                        <p id="check_command_div" class="am-u-sm-3" style="margin-top: 5px;"></p>
                                    </div>

                                    <div class="am-form-group">
                                        <label for="nodeGroup"
                                               class="am-u-sm-3 am-form-label">节点分组选择</label>
                                        <div class="am-u-sm-6 am-form">
                                            <select id="nodeGroup" name='groupName'>
                                                <option value="" disabled="disabled"  selected="selected">
                                                    -请选择计算节点分组
                                                </option>
                                            </select>
                                        </div>
                                        <p id="check_scheduling_div" class="am-u-sm-3" style="margin-top: 5px;"></p>
                                        <span class="am-form-caret"></span>
                                    </div>

                                    <div class="am-form-group">
                                        <label for="gpu"
                                               class="am-u-sm-3 am-form-label">GPU型号选择</label>
                                        <div class="am-u-sm-6 am-form">
                                            <select id="gpu" name='gpuId'>
                                                <option value="" disabled="disabled" selected="selected">
                                                    -请选择GPU型号
                                                </option>
                                            </select>
                                        </div>
                                        <p id="check_gpu_div" class="am-u-sm-3" style="margin-top: 5px;"></p>
                                        <span class="am-form-caret"></span>
                                    </div>
                                    <div class="am-form-group">
                                        <label for="ip" class="am-u-sm-3 am-form-label">节点受限进程</label>
                                        <div class="am-u-sm-6">
                                            <input type="text" id="limitProcess" name='limitProcess' placeholder="节点受限进程名，多个时用英文分号隔开。">
                                        </div>
                                        <p id="check_command_div" class="am-u-sm-3" style="margin-top: 5px;"></p>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>

<script src="${ctx}/assets/js/jQuery/jquery.min.js"></script>
<script src="${ctx}/assets/js/jQuery/jquery-1.9.1.js"></script>
<!-- <script src="${ctx}/assets/js/utils.js"></script> -->
<script src="${ctx}/assets/js/common/config.js"></script>
<script src="${ctx}/assets/js/common/amazeui.min.js"></script>
<script src="${ctx}/assets/js/common/app.js"></script>
<script src="${ctx}/assets/js/common/select2.full.js"></script>
<script src="${ctx}/assets/js/common/xcConfirm.js"></script>
<script src="${ctx}/assets/js/layer/layer.js"></script>
<script src="${ctx}/assets/js/node/nodeRegister.js"></script>
<script type='text/javascript'>
function sub(){
	//undefined
	//i//f($("#res").val()!="" && $("#res").val()!=null && $("#res").val()!=undefined)
	//	subGPU();//alert($("#res").val())
	//if($("#name").val()!=""  && $("#name").val()!=null && $("#name").val()!=undefined)
		subHost();//laert($("#name").val());
		//subGPU();
	//subNode();
}
// function subGPU() {		
// 	//console.info($('#gpuInfo').serialize());
//    console.info($('#gpuInfo').serializeArray());
// 	 $.ajax({
//          method : 'post',
//          url : 'conf/gpuInfo.action',
//          dateType:'json',
//          data : $('#gpuInfo').serializeArray(),
//          success : function(data) {
//             //alert(data);
//          }
//      });
// 	return false;
// }
function subHost() {		
	//console.info($('#hostAndGroup').serialize());
   console.info($('#hostAndGroup').serializeArray());
	 $.ajax({
         method : 'post',
         url : 'conf/hostgroup.action',
         dateType:'json',
         data : $('#hostAndGroup').serializeArray(),
         success : function(data) {
            //alert(data);
         }
     });
	return false;
}
// function subNode() {		
// 	//console.info($('#hostAndGroup').serialize());
//    //console.info($('#hostAndGroup').serializeArray());
//    //console.info($('#hostAndGroup').serializeArray().concat($('#gpuInfo').serializeArray()));
// 	 $.ajax({
//          method : 'post',
//          url : 'conf/hosts.action',
//          dateType:'json',
//          data : $('#hostAndGroup').serializeArray(),
//          success : function(data) {
//             //alert(data);
//          }
//      });
// 	return false;
// }
// function queryAjax(thiz, methods,urls){
// 	console.info($(thiz).serialize());
// 	   console.info($(thiz).serializeArray());
// 		 $.ajax({
// 	         method : method,
// 	         url : urls,
// 	         dateType:'json',
// 	         data : $(thiz).serializeArray(),
// 	         success : function(data) {
// 	            //alert(data);
// 	         }
// 	     });
// 		return false;
// }
// function queryAjaxPost(thiz,urls){
// 	return queryAjax(thiz, "post",urls)
// }
// function addOne(){
// 	//alert("此方法修改涉及");document.getEelementById("#plm")
// 	//$("#plm")
// 	var div1=document.createElement("div");
// 	div1.innerHTML=('<label  class=\"am-u-sm-3 am-form-label\"></label>'+
//     		'<div class=\"am-u-sm-6\">'+
// 			'<input type=\"text\"  name=\"limit_process\" placeholder=\"输入进程名\">'+
// 			'</div>    '+
// 			'<p  class=\"am-u-sm-3\"></p>')
// 	/*var ele=document.createElement('<label  class=\"am-u-sm-3 am-form-label\"></label>'+
//     		'<div class=\"am-u-sm-6\">'+
// 			'<input type=\"text\"  name=\"limit_process\" placeholder=\"输入进程名\">'+
// 			'</div>    '+
// 			'<p  class=\"am-u-sm-3\"></p>');//*/
// 	document.getElementById('processLimitDiv').append(div1)
// }
</script>
</body>

</html>